/**
    \file hxhtalarmxml.h
    \brief Not used.
*/

#ifndef __HXHTALARMXML_H__
#define __HXHTALARMXML_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdbool.h>

#include <scheme.h>
#include "../alarm.h"
#include "../interlock.h"

/**
 * set alarm output status
 * @param
 *		pGpio	output	gpio pointer
 *		pXmlBuff	input	xml buffer
 */
void hxhtSetAlarmOutputStatus(AlarmGPIO *pGpio, char *pXmlBuff, int buffSize);

/**
 * get alarm out put status
 * @param
 *		pXmlBuff	output	xml buffer
 *		buffSize	input	buffer size
 *		pGpio	input	gpio pointer
 * @return
 *		output size, -1 when buffer is too small or error occur
 */
int hxhtGetAlarmOutputStatus(char *pXmlBuff, int buffSize, AlarmGPIO *pGpio);

/**
 * set alarm Scheme, will alloc memory to ppList for store scheme, use shoud free it when not use
 * @param
 *		pXmlBuff	input	xml buffer
 * @return
 *		Scheme list head pointer, NULL when no Scheme or error
 */
Scheme *hxhtSetAlarmSchemeList(char *pXmlBuff, int buffSize);

/**
 * get alarm Scheme
 * @param
 *		pXmlBuff	output	xml buffer
 *		buffSize	input	buffer size
 *		pList		input	Scheme list head pointer
 * @return
 *		output size, -1 when buffer size is too small or error occur
 */
int hxhtGetAlarmSchemeList(char *pXmlBuff, int buffSize, Scheme *pList);

/**
 * set alarm output Scheme
 * @param
 *		pXmlBuff	input	xml buffer
 * @return
 *		Scheme list head pointer
 */
Scheme *hxhtSetAlarmOutputSchemeList(char *pXmlBuff, int buffSize);

/**
 * get alarm output Scheme
 * @param
 *		pXmlBuff	output	xml buffer
 *		buffSize	input	buffer size
 *		pList		input	Scheme list pointer
 * @return
 *		output size, -1 when buffer is too small or error occur
 */
int hxhtGetAlarmOutputSchemeList(char *pXmlBuff, int buffSize, Scheme *pList);

/**
 * generate alarm message to pXmlBuff
 * @param
 *		pXmlBuff	output	xml buffer
 *		buffSize	input	xml buffer size
 *		pDevName	input	alarm device name
 *		devType	input	alarm device type
 *		event	input	alarm event type
 * @return
 *		output size, -1 when buffer is too small or error occur
 */
int hxhtSendAlarmMsg(char *pXmlBuff, int buffSize, char *pDevName, int devType, int event);

#ifdef __cplusplus
}
#endif

#endif	// __HXHTALARMXML_H__

